Skip to content

fix: recover from oversized JSON-RPC frames#111

Draft
PsiACE wants to merge 1 commit into
mainfrom
fix/recover-oversized-frames
Draft

fix: recover from oversized JSON-RPC frames#111
PsiACE wants to merge 1 commit into
mainfrom
fix/recover-oversized-frames

Conversation

@PsiACE

@PsiACE PsiACE commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

Related issues

Close #62

Testing

Docs & screenshots

Checklist

  • Conventional Commit title (e.g. feat:, fix:).
  • Tests cover the change or are not required (explain above).
  • Docs/examples updated when behaviour is user-facing.
  • Schema regenerations (make gen-all) are called out if applicable.

Comment thread src/acp/connection.py
consumed = 1
if consumed > 0:
try:
await self._wait_for_reader(self._reader.readexactly(consumed))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we handle TimeoutError?

Comment thread src/acp/connection.py
except asyncio.IncompleteReadError as exc:
return exc.partial
except asyncio.LimitOverrunError as exc:
await self._discard_oversized_line(exc.consumed)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of dropping the line and emit a warning, how about we read maximum limit bytes and concatenate the result manually?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: LimitOverrunError in _receive_loop() crashes connection without recovery

2 participants